﻿<%@ Page Language="C#" MasterPageFile="~/Manage/MainPage.master"  AutoEventWireup="true" CodeFile="NewsManage.aspx.cs" Inherits="Manage_NewsManage" %>
<%@ Import Namespace="Shopping.Common" %>
<%@ Import Namespace="Shopping.Model" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Content" Runat="Server">
<script type="text/javascript" src="/FckEditor/fckeditor.js"></script> 
<script type="text/javascript" src="/Manage/Js/NewsManage.js"></script>
<script type="text/javascript">
    SelectOptionOfCategory = '<%=SelectOptionOfCategory %>';
    ModelOfNews = <% = new News().ToJsonString() %>;
</script>


<table width="99%" border="0" cellspacing="0" cellpadding="0" class="table" align="center">
  <tr>
    <td align="center"><img src="/Manage/Images/sousuo.gif" />资讯类别：
      <select name="ddlCategoryIDOfSearch" id="ddlCategoryIDOfSearch">
        <option value="">---不限---</option>
         <%=SelectOptionOfCategory %>
        </select>
         标题：
         <input name="txtKeyWordsOfSearch" type="text" id="txtKeyWordsOfSearch" size="20" value="<%=qo.KeyWords %>"  class="border6"/>
      创建日期：
      <input name="txtStartDateOfSearch" type="text" id="txtStartDateOfSearch"  value="<%=qo.StartDate %>"   size="12" maxlength="12" readonly="readonly"
                        onfocus="new WdatePicker({el:this})"  class=" Wdate" style="cursor: hand"/>
      -
      <input name="txtEndDateOfSearch" type="text" id="txtEndDateOfSearch"  size="12" maxlength="12" readonly="readonly"
                        onfocus="new WdatePicker({el:this})"  value="<%=qo.EndDate %>" class=" Wdate" style="cursor: hand"/>
      状态：
      <select name="ddlStatusOfSearch" id="ddlStatusOfSearch">
        <option value="">-全部-</option>
        <option value="正用"  <%= qo.Status== Status.正用.ToString()?"Selected":"" %>>正用</option>
        <option value="停用"  <%= qo.Status== Status.停用.ToString()?"Selected":"" %>>停用</option>
      </select>
      排序方式：
      <select name="ddlSortsOfSearch" id="ddlSortsOfSearch">
        <option value="0">-默认排序-</option>
        <option value="2"  <%= 2== qo.Sorts?"Selected":"" %>>创建日期降序</option>
        <option value="1"  <%= 1== qo.Sorts?"Selected":"" %>>创建日期升序</option>
        <option value="4"  <%= 4== qo.Sorts?"Selected":"" %>>点击数降序</option>
        <option value="3"  <%= 3== qo.Sorts?"Selected":"" %>>点击数升序</option>
      </select>
      <input name="btnSearch" type="button" id="btnSearch" value="执行搜索" class="btn2" onclick="GoToSearch();" />
      [ <a href="NewsManage.aspx" class="red bold">查看全部</a> ]
      </td>
  </tr>
</table>
<br />
<table width="99%" border="0" cellspacing="0" cellpadding="0" class="table" align="center"  >
  <tr >
    <td colspan="8" align="left" class="HeadTitle">&gt;&gt;资讯管理</td>
    </tr>
  <tr class="TableHeadRow">
    <td width="50" align="center">编号</td>
    <td align="left">标题</td>
    <td width="100" align="center">类别</td>
    <td width="50" align="center">排序值 </td>
    <td width="80" align="center">点击数 
    <a title="降序排列" href="<%=Utility.GetNewUrl("Sorts", "4", false)%>" >↓</a><a title="升序排列" href="<%=Utility.GetNewUrl("Sorts", "3", false)%>" >↑</a></td>
    <td width="50" align="center">状态</td>
    <td width="130" align="center">创建日期 
    <a title="降序排列" href="<%=Utility.GetNewUrl("Sorts", "2", false)%>">↓</a><a title="升序排列" href="<%=Utility.GetNewUrl("Sorts", "1", false)%>" >↑</a></td>
    <td width="150" align="center">管理 [<a href="javascript:Add();" class="red">+添加资讯</a>] </td>
  </tr>

  <%
      if (listOfNews != null)
      {
          for (int i = 0; i < listOfNews.Count; ++i)
          {
              NewsInfo n = listOfNews[i];
  %>
  <tr  onmouseover="this.style.backgroundColor='#F2F2F2';" onmouseout="this.style.backgroundColor='#FFFFFF';" >
    <td align="center"> <%=(qo.CurPage-1)*qo.PageSize+i+1 %>.</td>
    <td align="left"><a href="/News/Show.aspx?NewsID=<%=n.news.NewsID %>" target="_blank" ><span style="color:<%=n.news.Colors %>"><%=n.news.Title %></span></a>
    <%
        if (n.news.IsTop == 1)
            Response.Write("&nbsp;&nbsp; [ <span class=\"red\">置顶</span> ]");           
    %>    </td>
    <td align="center"><a title="查看该类别下资讯" href="<%=Utility.GetNewUrl("CategoryID", n.news.CategoryID.ToString(), false)%>" ><%=n.CategoryName %></a></td>
     <td align="center" class="green bold"><%=n.news.OrderValue %></td>
    <td align="center" class="green bold"><%=n.news.Clicks %></td>
    <td align="center"><%=n.news.Status%></td>
    <td align="center"><%=n.news.CreateDate.ToString("yyyy-MM-dd HH:mm:ss")%></td>
    <td align="center">[ <a href="javascript:Edit(<%=n.news.NewsID %>);" >编辑</a> ] 
	 
	 [ <a href="javascript:Delete(<%=n.news.NewsID %>);" class="red">删除</a> ]   </td>
  </tr>
    <%}
       %>
 <tr>
    <td colspan="8" align="center" > <span class="page" >
        <%=Utility.GetPageLine(Utility.GetWebPageUrlNoCurPage(), qo.CurPage, qo.PageSize,10, qo.TotalCount)%>    
        </span></td>
    </tr>
    <%}
      else
      { %>
  <tr>
    <td colspan="8" align="center" class="red">[ 未找到任何信息！]</td>
    </tr>
    <%} %>
</table>

</asp:Content>
